<?PHP
  $current_page = "event_edit.php";
  $page_type = "S";
  require_once 'header.php';
?>
	<div id="page">
	  <div id="page-padding">
        <!-- start content -->	    
	    <div id="content">
	      <div id="content-padding">
            <h1>Edit Event</h1>
            <p>
			<?PHP
			
				$userid = $_POST["userid"];
				$eventid  = $_POST["eventid"];
				$eventname  = $_POST["eventname"];
				$postdate  = $_POST["postdate"];
				$locationname  = $_POST["locationname"];
				$street  = $_POST["street"];
				$city  = $_POST["city"];
				$state  = $_POST["state"];
				$zip  = $_POST["zip"];
				$starttime  = $_POST["starttime"];
				$endtime  = $_POST["endtime"];
				$description  = $_POST["description"];
				
				$sql = "update EVENT set UserID = '$userid', EventID = '$eventid', EName = '$eventname', Post_Date = '$postdate', "
					." LCName = '$locationname', Street = '$street', City = '$city', State = '$state', Zip = '$zip', S_Time = '$starttime', "
					." E_Time = '$endtime', Description = '$description' where UserID = '$userid' and EventID = '$eventid'";
				
				$result_array = execute_sql_in_oracle($sql);
				$result = $result_array["flag"];
				$cursor = $result_array["cursor"];
				if (!$result){
					$edit_error = "<br>Event '$eventid' update failed.<br>";
					header("Location:event.php?edit_error=$edit_error");
				}
				else
					echo("Update Successful!");
			?>
			</p>
	      </div>
		</div>
	  <!-- end content --></div>
	  <div id="footer">
	    <div id="footer-pad">
	      <div class="line"></div>
		  <!-- footer and copyright notice -->
	      <p>Design by <a href="http://www.steves-templates.com">Steve's free website templates</a>.</p>
		  <!-- end footer and copyright notice -->
	    </div>
	  </div>
	</div>
  </body>
</html>